/**
 * User: yd
 * Date: 2019/5/30
 * Time: 17:21
 **/
import { users } from "./data/user";
export const login = (params)=>{
	//console.log(params)
	let {username, password} = JSON.parse(params.body);
	let {onUsername, onPassword,name } = users;
	
	let resdata = {
		code : 404,
		data : {},
		message:''
	};
	if(username != onUsername){
		resdata.message = '用户名错误';
	}else if(password != onPassword){
		resdata.message = '密码错误';
	}else{
		resdata.code  = 200;
		resdata.data.name  = name;
		resdata.message = '登录成功';
	}
	
	return {
		...resdata
	};
}